import { Input, Menu, Dropdown, Icon, List, Avatar, Button, Carousel, Select, notification } from 'antd';
import React, { useState, useRef, useEffect } from 'react';


var storage = window.localStorage;
export function use_fqbq_fg_pdxj_initcolmun() {
  return [{ show: true, title: "序号", key: "xuhao" },

  { show: true, title: "小卷批号", key: "bh" },
  
  { show: true, title: "原批号", key: "fbqph" },
  { show: true, title: "型号", key: "xh" },
  { show: true, title: "类别", key: "gg" },
  { show: true, title: "物料编码", key: "wlbm" },
  { show: true, title: "重量", key: "bqzl" },

  { show: true, title: "厚度", key: "hd" },
  { show: true, title: "长度", key: "changdu" },
  { show: true, title: "宽度", key: "kd" },

  ]
}


export function use_fqbq_fg_pd_initcolmun() {
  return [{ show: true, title: "序号", key: "xuhao" },
  { show: true, title: "报工日期", key: "djrq" },
  { show: true, title: "订单号", key: "ddh" },
  { show: true, title: "批号", key: "bh" },
  { show: true, title: "型号", key: "xh" },
  { show: true, title: "类别", key: "gg" },
  { show: true, title: "物料编码", key: "wlbm" },
  { show: true, title: "厚度", key: "hd" },
  { show: true, title: "长度", key: "changdu" },
  { show: true, title: "宽度", key: "kd" },
  { show: true, title: "总长度", key: "zcd" },
  { show: true, title: "总面积", key: "zmj" },

  { show: true, title: "等级", key: "djmc" },
  { show: true, title: "质量等级", key: "qcdj" },
  { show: true, title: "报工人", key: "bgr" },
  { show: true, title: "产线", key: "cx" },
  { show: true, title: "班组", key: "banzu" },
  { show: true, title: "报工时间", key: "bgsjstr" }]
}

/**
 * 
 * @param {*} formdata 
 * @returns 
 */
export function use_fqbq_fg_pd_initformdata() {
  var initformdata = {
    id: { bt: false, ifdb: true, dataIndex: 'id', title: 'id', value: '', inputType: 'none' },
    djph_title: { bt: false, ifdb: false, dataIndex: 'djph_title', title: '大卷信息', value: '', inputType: 'title_item' },

    gdh: { bt: false, ifdb: true, dataIndex: 'gdh', title: '工单号', value: '', inputType: 'input_item',  },
    gdid: { bt: false, ifdb: true, dataIndex: 'gdid', title: '工单id', value: '', inputType: 'none' },
    // fst_gdzl: { bt: false, ifdb: true, dataIndex: 'fst_gdzl', title: '福斯特_固定重量', value: '', inputType: 'none' },
    bh: {bt: true, ifdb: true, dataIndex: 'bh', title: '批号', value: '', inputType: 'input_item',},
    khmb: {
      bt: true, ifdb: true, dataIndex: 'khmb', title: '客户模板', value: '盘带模板', inputType: 'none',
      disabled:true,
      selectdata: [
        { value: '中文普通模板', label: "中文普通模板" },
        { value: '中文二维码模板', label: "中文二维码模板" },
        { value: '中文中性模板', label: "中文中性模板" },
        { value: '乐凯模板', label: "乐凯模板" },
        { value: '高阳模板', label: "高阳模板" },
        { value: '福斯特模板', label: "福斯特模板" },
        { value: '盘带模板', label: "盘带模板" }]
    },
    mjbh: {
      bt: true, ifdb: true, dataIndex: 'mjbh', title: '母卷号', value: '', inputType: 'readonly',
 
    },
    djbm: { bt: true, ifdb: true, dataIndex: 'djbm', title: '等级编码', value: '', inputType: 'none' },
    qcdj: {
      bt: true, ifdb: true, dataIndex: 'qcdj', title: '质量等级', value: '', inputType: 'select_item_ld',
      selectdata: [{ value: 'Y', label: "Y" }, { value: 'D', label: "D" }, { value: 'M', label: "M" },
      { value: 'H', label: "H" }, { value: 'X', label: "X" }, { value: 'F', label: "F" }]
    },
    kdh: {
      bt: true, ifdb: true, dataIndex: 'kdh', title: '客户号', value: '', inputType: 'select_item',
      selectdata: []
    },
    djmc: {
      bt: true, ifdb: true, dataIndex: 'djmc', title: '等级名称', value: '401', inputType: 'none',
      selectdata: [{ value: '401', label: "优等品" }, { value: '402', label: "合格品" },],disabled: true
    },
    bzdh: { bt: false, ifdb: true, dataIndex: 'bzdh', title: '标准代号', value: '', inputType: 'none' },
    ddh: { bt: false, ifdb: true, dataIndex: 'ddh', title: '订单号', value: '0.5乳白PET', inputType: 'none',disabled: true,
  selectdata:[{ value: 'KP20-PCT48H', label: "KP20-PCT48H" }, { value: 'KP20-PCT60H', label: "KP20-PCT60H" },
  { value: 'KP20-PCT72H', label: "KP20-PCT72H" },{ value: '0.5乳白PET', label: "0.5乳白PET" }
] },
    wlmc: { bt: false, ifdb: true, dataIndex: 'wlmc', title: '物料名称', value: '', inputType: 'none', disabled: true },
    gg: { bt: true, ifdb: true, dataIndex: 'gg', title: '类别', value: '', inputType: 'none', disabled: true },
    xh: { bt: true, ifdb: true, dataIndex: 'xh', title: '型号', value: '', inputType: 'none', disabled: true },
    changdu: { bt: true, ifdb: true, dataIndex: 'changdu', title: '长度', value: '', inputType: 'input_number_item' ,disabled: true,},
    kd: { bt: true, ifdb: true, dataIndex: 'kd', title: '宽度', value: '', inputType: 'input_number_item',disabled: true },
    hd: { bt: true, ifdb: true, dataIndex: 'hd', title: '厚度', value: '', inputType: 'input_number_item', disabled: true },
    cx: { bt: true, ifdb: true, dataIndex: 'cx', title: '产线', value: '', inputType: 'readonly' },
    wlbm: { bt: false, ifdb: true, dataIndex: 'wlbm', title: '物料编码', value: '', inputType: 'none', disabled: true },
    gx: {
      bt: true, ifdb: true, dataIndex: 'gx', title: '管芯', value: '', inputType: 'none', disabled: true,
      selectdata: [{ value: '6英寸', label: "6英寸" }, { value: '3英寸', label: "3英寸" },
      ]
    },
    dy: {
      bt: true, ifdb: true, dataIndex: 'dy', title: '电晕', value: '', inputType: 'none', disabled: true,
      selectdata: [{ value: '双电', label: "双电" }, { value: '无电', label: "无电" }, { value: '内电', label: "内电" },
      { value: '外电', label: "外电" },
      ]
    },
    qcdjbm: {
      bt: true, ifdb: true, dataIndex: 'qcdjbm', title: '质量等级编码', value: '', inputType: 'none',
    },
    kfkh: {
      bt: false, ifdb: true, dataIndex: 'kfkh', title: '可发客户', value: '', inputType: 'select_item_mutiple',
      mode: "multiple", oneline: true,
      selectdata: []
    },
    sjcd: { bt: true, ifdb: true, dataIndex: 'sjcd', title: '实际长度', value: '', inputType: 'none',disabled: true,},
    sjkd: { bt: true, ifdb: true, dataIndex: 'sjkd', title: '实际宽度', value: '', inputType: 'none',disabled: true, },
    sjhd: { bt: true, ifdb: true, dataIndex: 'sjhd', title: '实际厚度', value: '', inputType: 'none', disabled: true, },
    md: { bt: true, ifdb: true,   dataIndex: 'md',   title: '密度', value: '', inputType: 'none',disabled: true, },
    jszl: { bt: false, ifdb: true, dataIndex: 'jszl',title: '计算重量', value: '', inputType: 'none', disabled: true },
    fgcs: { bt: false, ifdb: true, dataIndex: 'fgcs', title:'返工次数', value: 0, inputType: 'none' },
    fgcj: { bt: false, ifdb: true, dataIndex: 'fgcj', title: '返工车间', value: '', inputType: 'none' },
    sffg: { bt: false, ifdb: true, dataIndex: 'sffg', title: '是否返工', value: '', inputType: 'none' },
    fbqph: {bt: true, ifdb: true, dataIndex: 'fbqph', title: '原批号', value: '', inputType: 'input_item',disabled:"true"},
    gxzl: {bt: true, ifdb: true, dataIndex: 'gxzl', title: '管芯重量', value: 0, inputType: 'none',disabled: true,},
    czzl: {bt: true, ifdb: true, dataIndex: 'czzl', title: '称重重量', value: '', inputType: 'none',disabled:true},
    bqzl: {bt: true, ifdb: true, dataIndex: 'bqzl', title: '标签重量', value: '', inputType: 'input_number_item',disabled: true,},
    zl: {bt: true, ifdb: true, dataIndex: 'zl', title: '重量', value: '', inputType: 'none',},
    js: {bt: true, ifdb: true, dataIndex: 'js', title: '卷数', value: 1, inputType: 'input_number_item',disabled:true},
    zcd: {bt: false, ifdb: true, dataIndex: 'zcd', title: '总长度', value: '', inputType: 'input_number_item',disabled:true},
    zmj: {bt: false, ifdb: true, dataIndex: 'zmj', title: '总面积', value: '', inputType: 'input_number_item',disabled:true},
    zzl: {bt: false, ifdb: false, dataIndex: 'zzl', title: '总重量', value: '', inputType: 'input_number_item',disabled:true},
    space_line_2: {bt: false, ifdb: false, dataIndex: 'space_line_2', title: 'space_line_2', value: '', inputType: 'space_line',disabled:true},
    fst_title: { bt: false, ifdb: false, dataIndex: 'fst_title', title: '福斯特填写项', value: '', inputType: 'title_item' },
    fst_gd: { bt: false, ifdb: true, dataIndex: 'fst_gd', title: '高度[福斯特]', value: '180', inputType: 'input_item' },
    fst_gwh: { bt: false, ifdb: true, dataIndex: 'fst_gwh', title: '工位号[福斯特]', value: '', inputType: 'input_item', disabled: true },
    fst_jh: {
      bt: false, ifdb: true, dataIndex: 'fst_jh', title: '颜色【福斯特】', value: '', inputType: 'select_item',
      selectdata: [{ value: '乳白PET', label: "乳白PET" }, { value: '白色PET', label: "白色PET" }]
    },
    fst_wlbm: {
      bt: false, ifdb: true, dataIndex: 'fst_wlbm', title: '物料编码[福斯特]', value: '', inputType: 'select_item',
      selectdata: []
    },
    gy_title: { bt: false, ifdb: false, dataIndex: 'gy_title', title: '高阳填写项', value: '', inputType: 'title_item' },
    bqys_gy: {
      bt: false, ifdb: true, dataIndex: 'bqys_gy', title: '标签颜色[高阳]', value: '', inputType: 'select_item',
      selectdata: [{ value: '白标', label: "白标" }, { value: '绿标', label: "绿标" }]
    },
    hxmh_gy: {
      bt: false, ifdb: true, dataIndex: 'hxmh_gy', title: '行项目号[高阳]', value: '', inputType: 'select_item',
      selectdata: [{ value: '10', label: "10" }, { value: '20', label: "20" }, { value: '30', label: "30" }]
    },
    wlbm_gy: {
      bt: false, ifdb: true, dataIndex: 'wlbm_gy', title: '物料编码[高阳]', value: '', inputType: 'select_item',
      selectdata: []
    },
    jh_gy: { bt: false, ifdb: true, dataIndex: 'jh_gy', title: '卷号[高阳]', value: '', inputType: 'input_item' },
    gysbm_gy: { bt: true, ifdb: true, dataIndex: 'gysbm_gy', title: '供应商编码[高阳]', value: 'A1020', inputType: 'select_item',
    selectdata: [{ value: 'A1020', label: "A1020" }, { value: '100736', label: "100736" }],disabled:true
   },

    lk_title: { bt: false, ifdb: false, dataIndex: 'lk_title', title: '乐凯填写项', value: '', inputType: 'title_item' },
    gwh_lk: {
      bt: false, ifdb: true, dataIndex: 'gwh_lk', title: '工位号_乐凯', value: '', inputType: 'select_item_ld',
      style: { fontSize: "0.6rem" },
      selectdata: [{ value: '47040000097', label: "春华汽配半透PET KP20(B48)240 μm" },
      { value: '47040000096', label: "春华汽配半透PET KP20(B48)275 μm" },
      { value: '47040000130', label: "春华汽配半透PET KP20(B48)280 μm" }
        , { value: '47040000131', label: "春华汽配半透PET KP20(B48)283 μm" },
      { value: '47040000098', label: "春华汽配半透PET KP20(B48)285 μm" },
      { value: '47040000132', label: "春华汽配半透PET KP20(B48)288 μm" },
      { value: '47040000100', label: "春华汽配普通透明 275 μm" },
      { value: '47040000113', label: "春华汽配普通透明 280 μm" },
      { value: '47040000114', label: "春华汽配普通耐紫外PET 275 μm" },
      { value: '47040000099', label: "春华汽配白PET 305 μm" }]
    },
    chbm_lk: {
      bt: false, ifdb: true, dataIndex: 'chbm_lk', title: '存货编码', value: '', inputType: 'readonly',
    },
    ph_lk: { bt: false, ifdb: true, dataIndex: 'ph_lk', title: '乐凯批号', value: '', inputType: 'input_item' },
    gysmc: { bt: false, ifdb: true, dataIndex: 'gysmc', title: '供应商名称', value: '', inputType: 'none' },
    bgr: { bt: false, ifdb: true, dataIndex: 'bgr', title: '报工人', value: '', inputType: 'none' },
    bgsj: { bt: false, ifdb: true, dataIndex: 'bgsj', title: '报工实际', value: '', inputType: 'none' },
    sftxhbxx: { bt: false, ifdb: true, dataIndex: 'sftxhbxx', title: '', value: '未更新', inputType: 'none' },
    sfxnrk: { bt: false, ifdb: true, dataIndex: 'sfxnrk', title: '', value: '', inputType: 'none' },
    banzu: { bt: false, ifdb: true, dataIndex: 'banzu', title: '', value: storage.loginbb, inputType: 'none' },
    bgrbh: { bt: false, ifdb: true, dataIndex: 'bgrbh', title: '', value: storage.ygbh, inputType: 'none' },  
    status: { bt: false, ifdb: true, dataIndex: 'status', title: '', value: '0', inputType: 'none' },  
    pdxj_title: { bt: false, ifdb: false, dataIndex: 'pdxj_title', title: '盘带小卷信息', value: '', inputType: 'title_item' },
    xjjs: { bt: false, ifdb: false, dataIndex: 'xjjs', title: '小卷卷数', value: '', inputType: 'input_number_item' },
    xjkd: { bt: false, ifdb: false, dataIndex: 'xjkd', title: '小卷宽度', value: '', inputType: 'input_number_item' },
    xjcd: { bt: false, ifdb: false, dataIndex: 'xjcd', title: '小卷长度', value: '', inputType: 'input_number_item' },
    xjzl: { bt: false, ifdb: false, dataIndex: 'xjzl', title: '小卷重量', value: '', inputType: 'input_number_item' },
    pddj_title: { bt: false, ifdb: false, dataIndex: 'pddj_title', title: '组合后批号', value: '', inputType: 'title_item' },
    zhzl: { bt: false, ifdb: false, dataIndex: 'zhzl', title: '组合重量', value: '', inputType: 'input_number_item' ,disabled: true},
    zhkd: { bt: false, ifdb: false, dataIndex: 'zhkd', title: '组合宽度', value: '', inputType: 'input_number_item',disabled: true },
    sfcz: { bt: false, ifdb: true, dataIndex: 'sfcz', title: '是否称重', value: '', inputType: 'input_number_item',disabled: true },


  }
  return initformdata
}

//带有回调的usestate
export function use_fqbq_fg_pd_changeformdata_bykhmb(formdata) {
  if (formdata.khmb.value == "福斯特模板") {
    formdata.ddh.bt=true
    formdata.gy_title.inputType = "none"
    formdata.bqys_gy.inputType = "none"
    formdata.bqys_gy.bt = false
    formdata.bqys_gy.value = ""
    formdata.hxmh_gy.inputType = "none"
    formdata.hxmh_gy.bt = false
    formdata.hxmh_gy.value = ""
    formdata.wlbm_gy.inputType = "none"
    formdata.wlbm_gy.bt = false
    formdata.wlbm_gy.value = ""
    formdata.jh_gy.inputType = "none"
    formdata.jh_gy.bt = false
    formdata.jh_gy.value = ""
    formdata.gysbm_gy.inputType = "none"
    formdata.gysbm_gy.bt = false
    formdata.gysbm_gy.value = ""
    formdata.fst_title.inputType = "title_item"
    formdata.fst_gd.inputType = "input_item"
    formdata.fst_gd.bt = true
    formdata.fst_gd.value = '180'
    formdata.fst_gwh.inputType = "input_item"
    formdata.fst_gwh.bt = true
    formdata.fst_jh.inputType = "select_item"
    formdata.fst_jh.bt = true
    formdata.fst_wlbm.inputType = "select_item"
    formdata.fst_wlbm.bt = true
//福斯特模板 订单号变为下拉框
formdata.ddh.inputType = "select_item"
formdata.ddh.value = ""


    formdata.lk_title.inputType = "none"
    formdata.chbm_lk.inputType = "none"
    formdata.chbm_lk.bt = false
    formdata.chbm_lk.value = ""
    formdata.ph_lk.inputType = "none"
    formdata.ph_lk.bt = false
    formdata.ph_lk.value = ""
    formdata.gwh_lk.inputType = "none"
    formdata.gwh_lk.bt = false
    formdata.gwh_lk.value = ""

  } else if (formdata.khmb.value == "高阳模板") {
    formdata.ddh.bt=true
    //高阳订单号改为输入框 
    formdata.ddh.inputType = "input_item"
    formdata.ddh.value = ""

    formdata.gy_title.inputType = "title_item"
    formdata.bqys_gy.inputType = "select_item"
    formdata.bqys_gy.bt = true
    formdata.hxmh_gy.inputType = "select_item"
    formdata.hxmh_gy.bt = true
    formdata.wlbm_gy.inputType = "select_item"
    formdata.wlbm_gy.bt = true
    formdata.jh_gy.inputType = "readonly"
    formdata.jh_gy.bt = true
    formdata.gysbm_gy.inputType = "select_item"
    formdata.gysbm_gy.bt = true


    formdata.fst_title.inputType = "none"
    formdata.fst_gd.inputType = "none"
    formdata.fst_gd.bt = false
    formdata.fst_gd.value = ""
    formdata.fst_gwh.inputType = "none"
    formdata.fst_gwh.bt = false
    formdata.fst_gwh.value = ""
    formdata.fst_jh.inputType = "none"
    formdata.fst_jh.bt = false
    formdata.fst_jh.value = ""
    formdata.fst_wlbm.inputType = "none"
    formdata.fst_wlbm.bt = false
    formdata.fst_wlbm.value = ""



    formdata.lk_title.inputType = "none"
    formdata.chbm_lk.inputType = "none"
    formdata.chbm_lk.bt = false
    formdata.chbm_lk.value = ""
    formdata.ph_lk.inputType = "none"
    formdata.ph_lk.bt = false
    formdata.ph_lk.value = ""
    formdata.gwh_lk.inputType = "none"
    formdata.gwh_lk.bt = false
    formdata.gwh_lk.value = ""

  }
  else if (formdata.khmb.value == "乐凯模板") {
    formdata.ddh.bt=false
    formdata.ddh.inputType = "input_item"
    formdata.ddh.value = ""


    formdata.gy_title.inputType = "none"
    formdata.bqys_gy.inputType = "none"
    formdata.bqys_gy.bt = false
    formdata.bqys_gy.value = ""
    formdata.hxmh_gy.inputType = "none"
    formdata.hxmh_gy.bt = false
    formdata.hxmh_gy.value = ""
    formdata.wlbm_gy.inputType = "none"
    formdata.wlbm_gy.bt = false
    formdata.wlbm_gy.value = ""
    formdata.jh_gy.inputType = "none"
    formdata.jh_gy.bt = false
    formdata.jh_gy.value = ""
    formdata.gysbm_gy.inputType = "none"
    formdata.gysbm_gy.bt = false
    formdata.gysbm_gy.value = ""


    formdata.fst_title.inputType = "none"
    formdata.fst_gd.inputType = "none"
    formdata.fst_gd.bt = false
    formdata.fst_gd.value = ""
    formdata.fst_gwh.inputType = "none"
    formdata.fst_gwh.bt = false
    formdata.fst_gwh.value = ""
    formdata.fst_jh.inputType = "none"
    formdata.fst_jh.bt = false
    formdata.fst_jh.value = ""
    formdata.fst_wlbm.inputType = "none"
    formdata.fst_wlbm.bt = false
    formdata.fst_wlbm.value = ""
    formdata.lk_title.inputType = "title_item"
    formdata.chbm_lk.inputType = "readonly"
    formdata.chbm_lk.bt = true
    formdata.ph_lk.inputType = "input_item"
    formdata.ph_lk.bt = true
    formdata.gwh_lk.inputType = "select_item_ld"
    formdata.gwh_lk.bt = true
  }
  else {
    formdata.ddh.bt=false
    formdata.ddh.inputType = "input_item"
    formdata.ddh.value = ""
    //中文普通，中文二维码，中文中性,盘带模板
    formdata.gy_title.inputType = "none"
    formdata.bqys_gy.inputType = "none"
    formdata.bqys_gy.bt = false
    formdata.bqys_gy.value = ""
    formdata.hxmh_gy.inputType = "none"
    formdata.hxmh_gy.bt = false
    formdata.hxmh_gy.value = ""
    formdata.wlbm_gy.inputType = "none"
    formdata.wlbm_gy.bt = false
    formdata.wlbm_gy.value = ""
    formdata.jh_gy.inputType = "none"
    formdata.jh_gy.bt = false
    formdata.jh_gy.value = ""
    formdata.gysbm_gy.inputType = "none"
    formdata.gysbm_gy.bt = false
    formdata.gysbm_gy.value = ""
    formdata.fst_title.inputType = "none"
    formdata.fst_gd.inputType = "none"
    formdata.fst_gd.bt = false
    formdata.fst_gd.value = ""
    formdata.fst_gwh.inputType = "none"
    formdata.fst_gwh.bt = false
    formdata.fst_gwh.value = ""
    formdata.fst_jh.inputType = "none"
    formdata.fst_jh.bt = false
    formdata.fst_jh.value = ""
    formdata.fst_wlbm.inputType = "none"
    formdata.fst_wlbm.bt = false
    formdata.fst_wlbm.value = ""
    formdata.lk_title.inputType = "none"
    formdata.chbm_lk.inputType = "none"
    formdata.chbm_lk.bt = false
    formdata.chbm_lk.value = ""
    formdata.ph_lk.inputType = "none"
    formdata.ph_lk.bt = false
    formdata.ph_lk.value = ""
    formdata.gwh_lk.inputType = "none"
    formdata.gwh_lk.bt = false
    formdata.gwh_lk.value = ""
  }


  return formdata
}



